// ==UserScript==
// @name szcw
// @author wgu
// @description  szcw
// @include http://bbs.szcw.cn/*
// ==/UserScript==
___jQuery.hostname='bbs.szcw.cn';

gw.import('pag/post.js',window);
(function($,jQuery){	

	jQuery.extend(jQuery.net.config,{			
		'sendURL':'http://bbs.szcw.cn/forum.php?mod=post&action=reply&fid={#fid}&tid={#tid}&extra=&replysubmit=yes&infloat=yes&handlekey=fastpost&inajax=1',
		'lockURLT':'http://bbs.szcw.cn/forum.php?mod=redirect&tid={#tid}&goto=lastpost#lastpost',
		'sendDate':'&subject=&posttime='+(new Date().valueOf()/1000|0-10)+'&message=',
		'lockT':8000,
		'lookT':500,
		'lookfl':20,
		'sendfl':2,
		'_reloadT':500,
		'_nextT':16500,
		'ckManage':gw.ckManage(["bbs.szcw.cn/"]),
		'getfl':function(t){ 
					var flsRe=/<em>\d+<\/em>/g,flRe=/\d+/;
					var fls=t.match(flsRe);
					return parseInt(fls[fls.length-1].match(flRe)[0]);
				}
	});
	
	var req=new XMLHttpRequest(),req2 = gw.req(),hostname=location.hostname;
	var panel=jQuery.net.cache,convert=gw.convert,ob=gw.ob,cookie=gw.cookie,ckManage=jQuery.net.config.ckManage;

	function send(){
		var mess=$('#message').val(),message=[];
		if(mess==""){
			alert('no message');
			return;
		}
		mess.split(';;;').forEach(function(v,i){
			message.push(gw.convert(parseurl(v)).replace(/%a(?=%|$)/g,'%0D%0A'));
		});
		jQuery.net.panel._send(window.fid,window.tid,message);
	}
	
	$.net.panel._panel(document.querySelector('.userid').textContent,[send]);	
	
})(___jQuery,___jQuery)


(function($,jQuery){	
	gw.import('pag/cache.js',window);
	gw.import('pag/post2.js',window);
	gw.import('load/szcw.js',window);
	if(window.top!=window){
		return;
	}
	jQuery.net.panel.init();
	
})(___jQuery,___jQuery)
